<?php
require_once("../phpGrid_Basic/conf.php");
include_once 'utiles.php';

if(login_check() == true) {
	$perfil = get_user_profile();
?>
<!DOCTYPE html>
<!-- saved from url=(0040)http://getbootstrap.com/examples/navbar/ -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="icon" href="http://getbootstrap.com/favicon.ico">

    <title>Servis Install</title>

	<link
		href="css/jquery-ui.css"
		rel="stylesheet">
	<!-- <link href="jquery-ui/css/custom-theme/jquery-ui-1.8.22.custom.css" rel="stylesheet">  -->

	<!-- Bootstrap core CSS -->
	<link rel="stylesheet"
		href="css/bootstrap.min.css">
	<!-- <link href="bootstrap/css/bootstrap.css" rel="stylesheet"> -->

	<!-- standard jqGrid CSS -->
	<!-- link href="jqGrid/css/ui.jqgrid.css" rel="stylesheet" -->

	<!-- Custom styles for this template -->
	<style type="text/css">

	body {
		padding-top: 30px;
		padding-bottom: 40px;
	}

	#content {
		width: 100%; 
		height: 100%; 
	}

	.navbar {
		margin-bottom: 30px;
	}

	.jumbotron {
		font-size: inheret;
		font-weight: 200;
		line-height: 1;
		color: inherit;
	}	
	</style>

	<!-- custom CCS override -->
	<!-- link href="jqGrid.bootstrap.css" rel="stylesheet" -->

    <!-- Bootstrap core CSS -->
    <!-- link href="css/bootstrap.min.css" rel="stylesheet"-->
	<!-- link href="css/jqGrid.bootstrap.css" rel="stylesheet"-->

    <!-- Custom styles for this template -->
	<!-- link href="css/signin.css" rel="stylesheet"-->
    <!-- link href="css/navbar.css" rel="stylesheet"-->
	<script src="js/jquery.min.js"></script>
  </head>

  <body>

    <div class="container">

      <!-- Static navbar -->
      <div class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="">Servis Install</a>
          </div>
          <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
			<li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Ordenes<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="main.php?pag=oe" >Ingreso de Ordenes</a></li>
                  <li><a href="main.php?pag=ot" >Registro de Trabajo</a></li>
				  <li><a href="main.php?pag=ce" >Certificacion de Ordenes</a></li>
				  <li><a href="main.php?pag=liq" >Pendiente Liquidacion Operarios</a></li>
                </ul>
            </li>
			<li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Reportes<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="main.php?pag=rv" >Rendiciones Diarias</a></li>
                  <li><a href="main.php?pag=ro" >Facturacion Operarios</a></li>
                  <li><a href="main.php?pag=ri" >Utilizacion Items</a></li>
                  <li><a href="main.php?pag=re" >OT por Estados</a></li>
                  <li><a href="main.php?pag=rp" >Productividad Operarios</a></li>
                </ul>
            </li>            
			<li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Listas de Precio<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="main.php?pag=ac" >Actividades e Items</a></li>
                  <li><a href="main.php?pag=lp" >Listas de Precios ASSA</a></li>
                  <li><a href="main.php?pag=lo" >Listas de Precios Operarios</a></li>                  
                </ul>
              </li>
			<li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Materiales<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="main.php?pag=ma" >Materiales</a></li>
                  <li><a href="main.php?pag=ms" >Movimientos de Stock</a></li>
                </ul>
              </li>        
			  <li><a href="main.php?pag=op">Operarios</a>
            <ul class="nav navbar-nav navbar-right">
            </ul>
        </li>
			<?php if ($perfil == 'ADMIN') { ?>
			  <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Administración<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="main.php?pag=admusr">Usuarios</a></li>
                  <li><a href="main.php?pag=em">Empresas</a></li>
                  <li><a href="main.php?pag=eu">Relacion Empresas Usuarios</a></li>                  
                </ul>
              </li>
			<?php }?>
			  <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Perfil<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                  <li><a href="main.php?pag=pass">Cambiar Contraseña</a></li>
                </ul>
              </li>
              <li><a href="logout.php">Salir</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div><!--/.container-fluid -->
      </div>

      <!-- Main component for a primary marketing message or call to action -->

	<?php
			$pag = !empty($_GET['pag']) ? $_GET['pag'] : 'oe';		
			$title = ['oe' => 'Ingreso de Ordenes',
						'ot' => 'Registro de Trabajo',
						'rv' => 'Rendiciones Diarios',
						'ro' => 'Facturacion Operarios',
						'ri' => 'Items Operarios',
						're' => 'OT por Estados',
						'rp' => 'Productividad Operarios',
						'lp' => 'Listas de Precios ASSA',
						'lo' => 'Listas de Precios Operarios',
						'ac' => 'Actividades e Items',
						'ma' => 'Materiales',
						'admusr' => 'Administración de Usuarios',
						'em'	=> 'Administración de Empresas',
						'eu'	=> 'Usuarios habilitados x Empresas',
						'pass' => 'Cambiar Contraseña',
						'op' => 'Operarios',
						'mo' => 'Materiales de la OT',
						'ms' => 'Movimientos de Stock',
						'ce' => 'Certificacion de Ordenes',
						'liq' => 'Pendiente Liquidacion Operarios',
						'hi' => 'Historial'];
			echo '<div class="jumbotron" >';
			echo 	'<h2>'. $title[$pag] .'</h2>';
				include($pag . '.php');				
			echo 	'</div>';		
	?>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/bootstrap.min.js"></script>

</body></html>
<?php
} else { 
    header('Location: login.php?error=2');
}
?>
